package modules.56lea.com
{
	import core.ProjectController;
	import core.GameLoader;
	import core.SysCmd;
	
	import flash.events.MouseEvent;
	public class 56lea.comController extends ProjectController
	{
		public static const NAME:String="56lea.comController";
		private var view:56lea.comView;
		public function 56lea.comController()
		{
			super();
		}
		override public function execute(param:Object=null, type:String=null):void{
			switch(type){
				case 56lea.comCmd.SHOW_WINDOW:
					showWindow();
					break;
				case 56lea.comCmd.CLOSE_WINDOW:
					closeWindow();
					break;
				case 56lea.comCmd.MODULE_NAME:
					init();
					break;
			}
		}
		private function init():void{
			view=new 56lea.comView();
			inited=true;
			showWindow();
		}
		private function showWindow():void{
			if(!inited){
				call(GameLoader.LOAD_MODULE_RESOURCE,56lea.comCmd.MODULE_NAME);
				return;
			}
			call(SysCmd.ADD_TO_STAGE,view,3);
			bindData();
			registerEvent();
		}
		private function closeWindow(e:MouseEvent=null):void{
			call(SysCmd.REMOVE_FROM_STAGE,view);
			destroy();
		}
		private function bindData():void{
			//这里绑定页面数据
		}
		private function registerEvent():void{
			//这里写监听事件
		}
		private function removeEvent():void{
			//这里移除监听
		}
		private function destroy(){
			removeEvent();
		}
	}
}
